package com.atung.parking.enums;

import lombok.Getter;

/**
 * @author Administrator
 */

@Getter
public enum MessageState {
    NORMAL(101, "发布中"),
    DELETED(102, "已删除");

    private final String description;
    private final Integer code;


    MessageState(int code, String description) {
        this.code = code;
        this.description = description;

    }
    public static String getDescriptionByCode(Integer code) {
        for (MessageState type : values()) {
            if (type.code.equals(code)) {
                return type.getDescription();
            }
        }
        return code.toString();
    }
}
